function initScroll(){
	// 区域滚动
	options = {
		scrollX:false,/*是否横向滚动*/
		scorllY:true,/*是否竖向滚动*/
		startX:0,/*初始化是滚动至x*/
		startY:0,/*初始化时滚动至y*/
		indicators:false,/*是否显示滚动条*/
		deceleration:0.0006,/*阻尼系数，系数越小越灵敏*/
		bounce:true,/*是否启用回弹*/
	}
	mui('.mui-scroll-wrapper').scroll(options);
}

window.LT = {}; 
LT.getParamsUrl = function(){
	var params = {};
	var search = decodeURI(location.search);
	if(search){
		search = search.replace('?',"");
		var arr = search.split('&');
		arr.forEach(function(item,i){
			var itemArr = item.split("=");
			params[itemArr[0]] = itemArr[1];
		})
	}
	return params;
}
LT.loginUrl = "/m/user/login.html"
LT.cartUrl = "/m/user/cart.html"
LT.userUrl = "/m/user/index.html"
LT.loginAjax = function(params){
	$.ajax({
		url: params.url || '#',
		type: params.type || 'get',
		data: params.data || '',
		dataType: params.dataType || 'json',
		success: function(res){
			if(res.error == 400){
				location.href = LT.loginUrl + '?returnRul=' + location.href;
				return false;
			}else {
				params.success && params.success(res);
			}
		},
		error:function(){
			mui.toast('服务器繁忙');
		}

	})
}


// json IE 6 7 有兼容问题 json2插件解决
LT.serilize2Object = function(data){
	var obj = {};
	if(data){
		var arr = data.split("&");
		arr.forEach(function(item,i){
			var itemArr = item.split("=");
			obj[itemArr[0]] = itemArr[1];
		})		
		return obj;
	}	

	return null;
}

LT.getItemById = function(array,id){
	var data = null;
	array.forEach(function(item,i){
		if(item.id){
			if(item.id == parseInt(id)){
				data = item;
			}
		}
	})
	return data;
}